import Vue from "vue";
import VueRouter from "vue-router";

import card from "./modules/card";
import life from "./modules/life";
import money from "./modules/money";
import shouye from "./modules/shouye";
import wode from "./modules/wode";

Vue.use(VueRouter);

const routes = [
    ...card,
    ...life,
    ...money,
    ...shouye,
    ...wode,
    // 重定向
    {
        path: "/",
        redirect: "/homes",
    },

    // 404页面
    {
        path: "*",
        component: () =>
            import ("../views/no.vue"),
    },
];

const router = new VueRouter({
    mode: "history",
    base: process.env.BASE_URL,
    routes,
});

export default router;